/*
 * @Description: for循环
 * @Author: rendc
 * @Date: 2022-09-05 09:51:08
 * @LastEditors: rendc
 * @LastEditTime: 2022-09-05 10:02:07
 */
for (var i = 0; i < 5; i++) {
  // console.log(i);
}
// for-in循环 专门遍历对象中的属性和值
var person = {
  name: "张三",
  age: 23,
  gender: "男"
}
for (var key in person) {
  // console.log(key + ":" + person[key]);
}
//for-in遍历数组 数组和对象是很相似的 都是键值对的形式 0:1
var arr = [1, 2, 3, 4, 5]
for (i in arr) {
  // console.log(i + ":" + arr[i]);
}

for (var i = 0; i < 5; i++) {
  if (i == 3) {
    break;
  }
  console.log("hello-break");
}
for (var i = 0; i < 5; i++) {
  if (i == 3) {
    continue;
  }
  console.log("hello-continue");
}